package yxj02;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

public class PrintWriteDemo {
    public static void main(String[] args) throws IOException {
        //PrintWriter pw = new PrintWriter("D:\\Ccode\\java-se\\IOStream\\src\\pw.txt");
//        pw.write("hello");
//        pw.write("\r\n")
//        pw.flush();
//        pw.write("world");
//        pw.flush();

//        pw.println("hello");
//        pw.flush();
//        pw.write("ddfsd");
//        pw.flush();

        //自动刷新
        PrintWriter pw = new PrintWriter(new FileWriter("D:\\Ccode\\java-se\\IOStream\\src\\pw.txt"),true);
        pw.println("hello");
        pw.println("were");
        pw.close();
    }
}
